<?php
/**
 *
 * PHP 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       app.View.Layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
$cakeDescription = __d('cake_dev', 'Pretty Little Treasures | Designer Recycle Boutique');
?>
<!DOCTYPE html>

        <head>
                <?php echo $this -> Html -> charset(); ?>
                    <title>
                        <?php echo $cakeDescription ?>:
                        <?php echo $title_for_layout; ?>
                    </title>


                <?php echo $this -> Html -> css('default'); ?>
                <?php echo $this -> Html -> css('bootstrap.min'); ?>
                <?php echo $this -> Html -> css('debug_toolbar.css'); ?>
                <?php echo $this -> Html -> script('jquery.min'); ?>
                <?php echo $this -> Html -> script('jquery.slidertron-1.1'); ?>
                <?php echo $this -> Html -> script('slideshowjquery.js'); ?>
                <?php //echo $this->Html->script('js_debug_toolbar.js'); ?>



   <?php
echo $this -> Html -> meta('icon');
echo $this -> fetch('meta');
echo $this -> fetch('css');
echo $this -> fetch('script');
                ?>
                <?php echo $this -> Html -> script('addtocart.js'); ?>
                <script type="text/javascript">var webroot = "<?php echo $webroot; ?>
					";
					//automatically close alert box
					setTimeout(function(){$("#flashMessage").hide();},2500);

                </script>
                <!-- jQuery library (served from Google) -->
<!--                 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> -->
                <!-- bxSlider Javascript file -->
                <?php //echo $this -> Html -> script('jquery.bxslider.min.js'); ?>
                <!-- bxSlider CSS file -->
                <?php //echo $this -> Html -> css('jquery.bxslider.css'); ?>
        </head>




        <body>

            <div id="wrapper" class="container effect8 ">
            
            
					<?php $admin = (isset($is_admin) ? $is_admin : FALSE); ?>
                    <?php if (!is_null($admin) and $admin === TRUE): ?>
	                    <div id="adminlogo">
		                    <?php
							echo $this -> Html -> link($this -> Html -> image('plt_2.png', array('alt' => 'Pretty Little Treasures', 'border' => '0', 'width' => '230')), 'http://www.prettylittletreasures.com.au/', array('target' => '_blank', 'escape' => false));
	                        ?>
	                    </div>
	                <?php else: ?>
	                	<div id="logo" class="logo">
	                        <?php
							echo $this -> Html -> link($this -> Html -> image('plt_3.png', array('alt' => 'Pretty Little Treasures', 'border' => '0', 'width' => '230')), 'http://www.prettylittletreasures.com.au/', array('target' => '_blank', 'escape' => false));
	                        ?>
	                    </div>
                    <?php endif; ?>

	                


                    <div id="top_section">

                        <?php if ($current_customer['group_id'] == 1): ?>
                            <div id="quicklink" class="quicklink" style="text-align: right;">
                                    <?php if ($logged_in): ?>
                                            <?php echo "Welcome " ?><?php echo $current_customer['username']; ?><?php echo " ," ?>
                                            <?php echo $this -> Html -> link(__('My account'), array('controller' => 'customers', 'action' => 'view', $current_customer['id'])); ?> <?php echo "  |  "?><?php echo $this -> Html -> link(__('Logout'), array('controller' => 'customers', 'action' => 'logout')); ?>
                                    <?php else: ?>
                                                <!-- else don't display logout and display login and register only -->
                                            <?php echo $this -> Html -> link(__('Register'), array('controller' => 'customers', 'action' => 'add')); ?>    <?php echo "l"?>    <?php echo $this -> Html -> link(__('Login'), array('controller' => 'customers', 'action' => 'login')); ?>
                                    <?php endif; ?>
                            </div>
                        <?php endif; ?>

                        <?php if ($current_customer['group_id'] != 1): ?>
                            <div id="quicklink1" class="quicklink1" style="text-align: right;">
                                    <?php if ($logged_in): ?>
                                            <?php echo "Welcome " ?><?php echo $current_customer['username']; ?><?php echo " ," ?>
                                            <?php echo $this -> Html -> link(__('My account'), array('controller' => 'customers', 'action' => 'view', $current_customer['id'])); ?> <?php echo "  |  "?><?php echo $this -> Html -> link(__('Logout'), array('controller' => 'customers', 'action' => 'logout')); ?>
                                    <?php else: ?>
                                                <!-- else don't display logout and display login and register only -->
                                            <?php echo $this -> Html -> link(__('Register'), array('controller' => 'customers', 'action' => 'add')); ?>    <?php echo "l"?>    <?php echo $this -> Html -> link(__('Login'), array('controller' => 'customers', 'action' => 'login')); ?>
                                    <?php endif; ?>
                            </div>
                        <?php endif; ?>


                        <?php if ($current_customer['group_id'] != 1): ?>
                            <div class="row">
                                <div class="pull-right">

                                    <!--<form action="<?php echo Router::url(array('controller' => 'items', 'action' => 'search')); ?>" method="post">
                                        <div class="input-append">
                                            <input type="text" name="keyword" placeholder="Search for Treasures ..." />
                                            <button class="btn" type="submit">Search</button>
                                        </div>
                                    </form>-->

                                    <!--<div class="input-append">
                                        <?php echo $this->Form->create('Item',array('action' => 'search'));?>
                                        <?php echo $this->Form->input('keyword', array('label' => false, 'placeholder' => 'Search for Treasures...', 'div' => false));?>
                                        <?php echo $this->Form->submit('Search', array('div' => false, 'class' => 'btn'));?>
                                    </div>


                                   <?php echo $this->Form->create('Item',array('action' => 'search'));?>
                                    <?php echo $this->Form->input('keyword', array('label' => 'Search for'));?>
                                    <?php echo $this->Form->end('Search');?>-->
                                </div>
                            </div>
                        <?php endif; ?>


                        <?php if (!is_null($admin) and $admin === TRUE): ?>
                        <?php else: ?>
                            <div id="shopping_bag" >
                               <?php echo $this -> Html -> image('shopping_bag.png', array('alt' => 'Shopping bag icon')); ?>  <?php echo $this -> Html -> Link(__('My shopping bag (0)'), array('controller' => 'shop', 'action' => 'cart', $current_customer['id'])); ?>
                            </div>
                        <?php endif; ?>
                    </div>





                    <?php $admin = (isset($is_admin) ? $is_admin : FALSE); ?>
                    <?php if (!is_null($admin) and $admin === TRUE): ?>
                        <div id="admin_menu">
                            <ul>
                                <li><?php echo $this -> Html -> link('Point of Sale', array('controller' => 'Point_of_sale', 'action' => 'index', 'plugin' => null)); ?></li>
                                <li><?php echo $this -> Html -> link('Customers', array('controller' => 'Customers', 'action' => 'index', 'plugin' => null)); ?>
                                	<ol class="sub_menu_3">
                                		<li><?php echo $this -> Html -> link('New', array('controller' => 'Customers', 'action' => 'add', 'plugin' => null)); ?></li>
                                	</ol>
                                </li>
                                <li><?php echo $this -> Html -> link('Items', array('controller' => 'Items', 'action' => 'index', 'plugin' => null)); ?>
                                	<ol class="sub_menu_1">
                                		<li><?php echo $this -> Html -> link('Brands', array('controller' => 'Brands', 'action' => 'index', 'plugin' => null)); ?></li>
                                		<li><?php echo $this -> Html -> link('Categories', array('controller' => 'Categories', 'action' => 'index', 'plugin' => null)); ?></li>
                                		<li><?php echo $this -> Html -> link('Colors', array('controller' => 'Colors', 'action' => 'index', 'plugin' => null)); ?></li>
                                		<li><?php echo $this -> Html -> link('Conditions', array('controller' => 'Conditions', 'action' => 'index', 'plugin' => null)); ?></li>
                                		<li><?php echo $this -> Html -> link('Sizes', array('controller' => 'Sizes', 'action' => 'index', 'plugin' => null)); ?></li>
                                		<li><?php echo $this -> Html -> link('Images', array('controller' => 'Images', 'action' => 'index', 'plugin' => null)); ?></li>
                                		<li><?php echo $this -> Html -> link('Markdowns', array('controller' => 'Items', 'action' => 'price', 'plugin' => null)); ?></li>
                                	</ol>
                                </li>
                                	
                                <li><?php echo $this -> Html -> link('Transactions', array('controller' => 'Sales', 'action' => 'index', 'plugin' => null)); ?>
                                	<ol class="sub_menu_2">
                                		<li><?php echo $this -> Html -> link('Sales', array('controller' => 'Sales', 'action' => 'index', 'plugin' => null)); ?></li>
                                		<li><?php echo $this -> Html -> link('Online sale', array('controller' => 'Online', 'action' => 'index', 'plugin' => null)); ?></li>
                                		<!--<li><?php echo $this -> Html -> link('Online Sales', array('controller' => 'Shop', 'action' => 'order', 'plugin' => null)); ?></li>-->
                                		<li><?php echo $this -> Html -> link('Lay-By', array('controller' => 'Sales', 'action' => 'layby', 'plugin' => null)); ?></li>
                                		<li><?php echo $this -> Html -> link('Purchase', array('controller' => 'Purchases', 'action' => 'index', 'plugin' => null)); ?></li>
                                		<li><?php echo $this -> Html -> link('Consignment', array('controller' => 'Consignments', 'action' => 'index', 'plugin' => null)); ?></li>

                                	</ol>
                                </li>
                                <li><?php echo $this -> Html -> link('Contacts', array('controller' => 'Suppliers', 'action' => 'index', 'plugin' => null)); ?> 
	                                <ol class="sub_menu_3">
	                                		<li><?php echo $this -> Html -> link('Suppliers', array('controller' => 'Suppliers', 'action' => 'index', 'plugin' => null)); ?></li>
	                                		<li><?php echo $this -> Html -> link('Consigners', array('controller' => 'Consigners', 'action' => 'index', 'plugin' => null)); ?></li>
	                                </ol>                                
                                </li>
                                <!--<li><?php echo $this->Html->link('Reports', array('controller'=>'pages', 'action'=>'Report','plugin'=>null));?></li>-->
                                <li><?php echo $this -> Html -> link('Deliveries', array('controller' => 'deliveries', 'action' => 'index', 'plugin' => null)); ?>
                                    <ol class="sub_menu_4">
                                                                            </ol>
                                </li>
                                <li><?php echo $this->Html->link('Content management', array('controller'=>'contents', 'action'=>'manage','plugin'=>null));?>
                                    <ol class="sub_menu_3">
                                        <li><?php echo $this->Html->link('Pages', array('controller'=>'Contents', 'action'=>'manage', 'plugin'=>null));?></li>
                                        <li><?php echo $this->Html->link('SlideShow', array('controller'=>'Uploadings', 'action'=>'index', 'plugin'=>null));?></li>
                                    </ol>
                                </li>
                            </ul>
                        </div>
                    <?php else: ?>

                        <div id="menu" >

                            <ul>
                                <li class="heart" style="top:-24px; left:-8%;"></li>
                                <li><?php echo $this -> Html -> link('Home', array('controller' => 'pages', 'action' => 'display', 'pagehome')); ?></li>
                                <li><?php echo $this -> Html -> link('About us', array('controller' => 'pages', 'action' => 'display', 'aboutus')); ?></li>
                                <li><?php echo $this -> Html -> link('Online Store', array('controller' => 'items', 'action' => 'publicIndex')); ?></li>
                                <li><?php echo $this -> Html -> link('Consignment', array('controller' => 'pages', 'action' => 'consignment')); ?></li>
                                <li><?php echo $this -> Html -> link('Contact Us', array('controller' => 'pages', 'action' => 'contactus')); ?></li>
                                <li class="heart" style="top:-23px;left:4.5%"></li>
                            </ul>
                        </div>
                    <?php endif; ?>

                    <div id="content">

                            <div id="main" class="ofh">
                                <?php echo $this -> Session -> flash(); ?>

                                <?php echo $this -> Session -> flash('Auth'); ?>

                                <?php echo $this -> fetch('content'); ?>
                            </div>

                            <div id="footer" style="color: #0088CC;">
                                <?php echo __('&#169; '); ?>
                                <?php echo $this -> Html -> link(__(' Pretty Little Treasure 2013'), array('controller' => 'pages', 'action' => 'pagehome')); ?>
                                <?php echo __(' &#124; '); ?>
                                <?php echo $this -> Html -> link(__(' Privacy Policy'), array('controller' => 'pages', 'action' => 'policy')); ?>
                                <?php echo __('&#124;'); ?>
                                <?php echo $this -> Html -> link(__(' Terms and Conditions'), array('controller' => 'pages', 'action' => 'terms')); ?>
                            </div>
                    </div>
            </div>
        </body>
</html>
